#ifndef G3_3DD_FILE_DLG_H
#define G3_3DD_FILE_DLG_H

#include "gui/gui.h"
#include "input.h"
#include "spline.h"

//==============================================================================
// Save button clickhandler
//==============================================================================
void SaveTheSpline (G3::GUI::EDITBOX *aEBox);
void SaveTheSpline (G3::INPUT *aInput, G3::GUI::WIDGET *aWidget);

//==============================================================================
// Load button clickhandler
//==============================================================================
void LoadTheSpline (G3::GUI::EDITBOX *aEBox);
void LoadTheSpline (G3::INPUT *aInput, G3::GUI::WIDGET *aWidget);

//==============================================================================
// Cancel button clickhandler
//==============================================================================
void CloseFileWindow (G3::INPUT *aInput, G3::GUI::WIDGET *aWidget);

//==============================================================================
// File open / save dialog
//==============================================================================
class FOPEN_DIALOG {
    public:
        FOPEN_DIALOG ();

        G3::GUI::GROUP group;
        G3::GUI::LABEL text;
        G3::GUI::EDITBOX filepath;
        G3::GUI::BUTTON ok_button;
		G3::GUI::BUTTON cancel_button;

		// For quick visibility checks
        bool Visible;

		// Creates an instance
        void Create (const G3::RECTI &rect, G3::FONT *font, const std::string &title, bool for_saving);

		// Hides and disables the dialog
        void Hide ();
		// Shows and enables the dialog
        void Show ();
};

//==============================================================================
// Global file dialogs
//==============================================================================
extern FOPEN_DIALOG fopenDlg;
extern FOPEN_DIALOG fsaveDlg;

#endif

